<?php
class RM_ReservationPickupDropoff extends RM_Model
{
    protected $_name = 'rm_reservation_pickupdropoff';

    function getByReservation($data){

        $reservationModel = new RM_Reservations();
        $reservation = $reservationModel->find($data->id)->current();
        $details = $reservation->findReservationDetails();

        $locations = array();
        foreach ($details as $detail){
            $locationData = $this->fetchAll("id='".$detail->id."'");
            $locations[] = $locationData[0];
        }

        return $locations;
    }

}
